<?php echo $this->view->menssagem; ?>
<div class="panel panel-default">
    <div class="panel-heading" style="text-align: center;font-weight: bold;">Consulta de Beneficiario</div>
    <div class="panel-body">

        <form class="form-inline" method="post" action="/caixa/beneficiario_lista">

            <div class="form-group">
                <input class="form-control" type="text" name="pesq" placeholder="Digite um nome para consultar" size="30"/>
            </div>
            <button class="btn btn-primary" type="submit" ><span class="glyphicon glyphicon-search"></span> Pesquisar</button>
        </form>
    </div>
</div>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>Código</th>
            <th>Nome</th>
            <th>Ação</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $total = 0;
        foreach ($this->view->lista as $c) {
            $total = $total + 1;
            echo '<tr>';
            echo '<td>';
            echo $c['id'];
            echo '</td>';
            echo '<td>';
            echo $c['nome'];
            echo '</td>';
            echo '<td>';
            echo "<form method='post' action='/caixa/beneficiario'>";
            echo "<input  name='id' value='{$c['id']}' type='hidden'></input> ";
            echo "<button class=\"btn btn-default\" type=\"submit\" ><span class=\"glyphicon glyphicon-pencil\"></span> Editar</button>";
            echo '</form>';
            echo '</td>';
            echo '</tr>';
        }
        ?>

    </tbody>
    <tfoot>
        <tr>
            <th>Total de Registros</th>
            <th></th>
            <th><?php echo $total; ?></th>
        </tr>
    </tfoot>
</table>

